<?php

namespace Controller\User;

class MyHome extends Base {

	public function actionIndex() {

		$userCondition = \Business\User::instance()->getUserConditionByUserId($this->userId);

		// 主人信息
		$userMasterInfo = \Business\User::instance()->getUserMasterInfoByUserId($this->userId);

		// 照片
		$photos = \Business\User::instance()->getUserPhotosByUserId($this->userId, 6);

		// 用户帖子
		$articlePager = new \Lib\Core\Pager();
		$articlePager->pageSize = 10;
		$articles = \Business\Article::instance()->findArticleByUserId($articlePager, $this->userId);
		$categoryInfoAndNumbers = \Business\Article::instance()->getHasArticleCategory($this->userId);

		$this->assign('userCondition', $userCondition);
		$this->assign('userMasterInfo', $userMasterInfo);
		$this->assign('photos', $photos);
		$this->assign('categoryInfoAndNumbers', $categoryInfoAndNumbers);
		$this->assign('articlePager',$articlePager);
		$this->assign('articles',$articles);
		$this->display();
	}
}